#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include "BCI2000FileReader.h"
#include "GenericSignal.h"
#include "Marker.h"
#include "GraphicsScene.h"
#include "DisplayFilter.h"
#include <QtGui>
#include <Qt>
#include <QKeyEvent>



namespace Ui {
    class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit MainWindow(QWidget *parent = 0);


    static short getSize();
    static int getShape();
    static QColor getColor();

	// Filters
    void HPOff();
    void HPRemoveMean();
    void HP1Hz();
    void HP5Hz();
    void LPOff();
    void LP30Hz();
    void LP40Hz();
    void LP70Hz();
    void NotchOff();
    void Notch50Hz();
    void Notch60Hz();
    bool Filter_Enabled() const;

    MainWindow* self();

    ~MainWindow();

private slots:
    void on_ImageSelectButton1_clicked();
    void on_ImageSelectButton2_clicked();
    void on_ImageSelectButton3_clicked();
	void on_SCPLoadDataButton_clicked();

    void on_YellowMarker_clicked();
    void on_BlueMarker_clicked();
    void on_GreenMarker_clicked();
    void on_OrangeMarker_clicked();
    void on_MagentaMarker_clicked();
    void on_BlackMarker_clicked();
    void on_WhiteMarker_clicked();

	void on_actionUndo_activated();
    void on_actionRedo_activated();

    bool eventFilter(QObject *obj, QEvent *event);

    void on_NoElectrodesSpinBox_valueChanged(int arg1);

    void on_ImageDirText1_returnPressed();
    void on_ImageDirText2_returnPressed();
    void on_ImageDirText3_returnPressed();

    void on_ShapeMenu_activated(int index);
    void on_SizeSpinBox_valueChanged(int index);

    void on_tabWidget_selected(const QString &arg1);

    void on_addMarker(qreal xpos1, qreal ypos1);
    void on_selection();

    void deletePressed();
    void on_listchanged();


private:

    Ui::MainWindow *ui;

    GraphicsScene *Escene;
    QGraphicsView *Eview;

    QGraphicsScene *VEscene;
    QGraphicsView *VEview;

    GraphicsScene *Sscene;
    QGraphicsView *Sview;

    GraphicsScene *SCPscene;
    QGraphicsView *SCPview;

    QString FileNameRec1;
    QString FileNameRec2;
    QString FileNameRec3;

    QString Cursorx;
    QString Cursory;

    QPointF Sceneposition;

    QList<QGraphicsItem*> Mainmarker;
	QList<QGraphicsItem*> scenelist;
    QListWidget* markerlist;

    int radioButtonSelected();
	const GenericSignal& ConstructDisplaySignal( long samplePos, long length );
	void DoFileOpen( const QString& name );
	bool FilterActive();

	BCI2000FileReader  mFile;
    long long          mSamplePos;
    int                mNumSignalChannels;
    bool               mPositionEdited;
    float              mSamplingRate;
	DisplayFilter      mFilter;
    bool               mRemoveMean;
	
	QShortcut shortcutdelete;



};

#endif // MAINWINDOW_H
